﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Hxj.Data;
using Utility;
using Utility.Model;
using Utility.Json;

namespace MsgCenter.Web.Handlers
{
    /// <summary>
    /// Handler_ApplicationReg 的摘要说明
    /// </summary>
    public class Handler_ApplicationReg : BaseUI.BaseHandler
    {
        /// <summary>
        /// 获取应用程序列表
        /// </summary>
        public void GetAppRegList()
        {
            WhereClip wcp = new WhereClip();
            string _search = ParamsOfRequest.Request("_search");
            if (_search != "true")
            {
                wcp = wcp.And(Sys_AppReg._.IsDelete == false);
            }
            var pageConditon = GetPageConditon(wcp);
            JsonJqGridData gridList = BLL.BLLServiceHelper.GetBaseDataService().GetGridDataTable<Sys_AppReg>(pageConditon);
            string strResult = gridList.ToJsonString();
            base.Response.Write(strResult);
        }
        /// <summary>
        /// 删除应用程序
        /// </summary>
        public void DeleteAppReg()
        {
            string strID = ParamsOfRequest.Request("RoleID");
            try
            {
                BLL.BLLServiceHelper.GetRegService().DeleteApp(strID);
                base.GetSuccessJson();
            }
            catch (Exception ex)
            {
                base.GetFailureJson(ex.Message);
            }
        }
    }
}